package cn.touna.jss.common.properties.config;

import com.baidu.disconf.client.common.annotations.DisconfFile;
import com.baidu.disconf.client.common.annotations.DisconfFileItem;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created by Steve.Tao on 2017/11/6.
 */
@Component
//@DisconfFile(filename = "mail.properties",targetDirPath = "disconf")
public class MailProperties {

    private boolean enable;
    private String to;
    private String cc;
    private String mailUrl;

    //@DisconfFileItem(name = "mail.enable",associateField = "enable")
    public boolean isEnable() {
        return enable;
    }
    @Value("${mail.enable}")
    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    //@DisconfFileItem(name = "mail.to",associateField = "to")
    public String getTo() {
        return to;
    }

    /**
     * 收件地址，多个邮箱地址用,分开（英文的逗号）
     * @param to
     */
    @Value("${mail.to}")
    public void setTo(String to) {
        this.to = to;
    }

    //@DisconfFileItem(name = "mail.cc",associateField = "cc")
    public String getCc() {
        return cc;
    }

    /**
     * 抄送地址，多个邮箱地址用,分开（英文的逗号）
     * @param cc
     */
    @Value("${mail.cc}")
    public void setCc(String cc) {
        this.cc = cc;
    }

    //@DisconfFileItem(name = "mail.mailUrl",associateField = "mailUrl")
    public String getMailUrl() {
        return mailUrl;
    }

    /**
     * 发送邮件的服务地址
     * @param mailUrl
     */
    @Value("${mail.mailUrl}")
    public void setMailUrl(String mailUrl) {
        this.mailUrl = mailUrl;
    }
}
